package psn.zjk.common.jdk8;

import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * @author zhangjk
 * @CREATE_TIME 2020/12/11 16:12
 */
public class LambdaUsage {

    public static void main(String[] args) {
//创建
        IntStream ints = new Random().ints(10);
//        ints不属于Stream，属于BaseStream，而collect(Collector)属于Stream的方法
        //加工：IntStream转Stream
        ints.boxed()
//                采集
                .collect(Collectors.toList());
        Stream<Object> objectStream = Stream.of("").flatMap(s -> {
            return Stream.of("");
        });
        objectStream.forEach(s -> {
            System.out.println(s);
        });
//        ints.
    }

}